snailalley.com/Design a 3D Game with JavaScript and WebGL
You would probably need a class for a level. Once a room is entered, a class for rooms is used and a particular room is loaded. Objects within the room have classes. One class could define the ground objects that the character is standing upon. If a surface can be stood on, the z coordinate could be determined on the plane below the character as a function of the class, by using it's triangle of vertexes in a calculation. A triangle of vertexes makes up a plane, in WebGL. |